import { createRouter, createWebHashHistory } from "vue-router";
// import index from "../layout/index.vue";

//subpage
// import customer from "../layout/subPage/customer.vue";
// import user from "../layout/subPage/goodsM.vue";
// import list from "../layout/subPage/list.vue";
// import goods from "../layout/subPage/goods.vue";
// import totalData from "../layout/subPage/totalData.vue";

const routes = [
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/acount/Login.vue"),
  },
  {
    path: "/",
    name: "Index",
    component: () => import("../layout/index.vue"),
    redirect: "/customer",
    children: [
      {
        path: "/customer",
        name: "Customer",
        component: () => import("../layout/subPage/customer.vue"),

      },
      {
        path: "/user",
        name: "User",
        component: () => import("../layout/subPage/goodsM.vue"),
      },
      {
        path: "/list",
        name: "List",
        component: () => import("../layout/subPage/list.vue"),
      },
      {
        path: "/goods",
        name: "Goods",
        component: () => import("../layout/subPage/goods.vue"),
      },
      {
        path: "/totalData",
        name: "TotalData",
        component: () => import("../layout/subPage/totalData.vue"),
      },

    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes,
});

export default router;
